]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspace, workspacesView: Cleanup animation methods
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 2 Jan 2021 19:17:17 +0000 (16:17 -0300)
committerMarge Bot <marge-bot@gnome.org>
Thu, 11 Feb 2021 15:50:31 +0000 (15:50 +0000)
Remove Workspace.zoomTo/FromOverview(), they're unused now. Rename
everything up to ControlsManager to prepareToEnter/LeaveOverview(),
since these classes don't run the animation anymore.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>

js/ui/overviewControls.js
js/ui/viewSelector.js
js/ui/workspace.js
js/ui/workspacesView.js

index 756943630caca6ab36bfe80837d21e67f055f508..9dbda145971d64f01d90374025c0270b383fe545 100644 (file)
@@ -178,7 +178,7 @@ class ControlsManager extends St.Widget {
     }
 
     animateToOverview(callback) {
-        this.viewSelector.animateToOverview();
+        this.viewSelector.prepareToEnterOverview();
 
         this._stateAdjustment.value = ControlsState.HIDDEN;
         this._stateAdjustment.ease(ControlsState.WINDOW_PICKER, {
@@ -194,7 +194,7 @@ class ControlsManager extends St.Widget {
     animateFromOverview(callback) {
         this._ignoreShowAppsButtonToggle = true;
 
-        this.viewSelector.animateFromOverview();
+        this.viewSelector.prepareToLeaveOverview();
 
         this._stateAdjustment.ease(ControlsState.HIDDEN, {
             duration: Overview.ANIMATION_TIME,
index 1ad725d0b1a13757d417864108abdeacfbd76c3d..95d6d7e5c7f425f80f55255f45034a132a861a41 100644 (file)
@@ -403,10 +403,10 @@ var ViewSelector = GObject.registerClass({
         Main.overview.show();
     }
 
-    animateToOverview() {
+    prepareToEnterOverview() {
         this.show();
         this.reset();
-        this._workspacesDisplay.animateToOverview();
+        this._workspacesDisplay.prepareToEnterOverview();
         this._activePage = null;
         this._showPage(this._activitiesPage);
 
@@ -414,8 +414,8 @@ var ViewSelector = GObject.registerClass({
             Main.overview.fadeOutDesktop();
     }
 
-    animateFromOverview() {
-        this._workspacesDisplay.animateFromOverview();
+    prepareToLeaveOverview() {
+        this._workspacesDisplay.prepareToLeaveOverview();
 
         if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
             Main.overview.fadeInDesktop();
index b37a7e39e21bc455ae23e6f0bd0e39909427cc31..954812bdc5fa29643bcb282f06eb152b740ee353 100644 (file)
@@ -6,7 +6,6 @@ const { Clutter, GLib, GObject, Graphene, Meta, St } = imports.gi;
 const Background = imports.ui.background;
 const DND = imports.ui.dnd;
 const Main = imports.ui.main;
-const Overview = imports.ui.overview;
 const Params = imports.misc.params;
 const Util = imports.misc.util;
 const { WindowPreview } = imports.ui.windowPreview;
@@ -1154,17 +1153,6 @@ class Workspace extends St.Widget {
         return false;
     }
 
-    zoomToOverview() {
-        const animate =
-            this.metaWorkspace === null || this.metaWorkspace.active;
-
-        const adj = this.layout_manager.stateAdjustment;
-        adj.ease(1, {
-            duration: animate ? Overview.ANIMATION_TIME : 0,
-            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
-        });
-    }
-
     prepareToLeaveOverview() {
         for (let i = 0; i < this._windows.length; i++)
             this._windows[i].remove_all_transitions();
@@ -1178,18 +1166,6 @@ class Workspace extends St.Widget {
         this._overviewHiddenId = Main.overview.connect('hidden', this._doneLeavingOverview.bind(this));
     }
 
-    zoomFromOverview() {
-        this.prepareToLeaveOverview();
-
-        if (this.metaWorkspace !== null && !this.metaWorkspace.active)
-            return;
-
-        this.layout_manager.stateAdjustment.ease(0, {
-            duration: Overview.ANIMATION_TIME,
-            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
-        });
-    }
-
     _onDestroy() {
         if (this._overviewHiddenId) {
             Main.overview.disconnect(this._overviewHiddenId);
index 5cdeb31859ee51c9f34b06786f368a453b1a11cf..67936c597ba994c35558554823d8398388cba38a 100644 (file)
@@ -130,6 +130,7 @@ class WorkspacesView extends WorkspacesViewBase {
         this._switchWorkspaceNotifyId =
             global.window_manager.connect('switch-workspace',
                                           this._activeWorkspaceChanged.bind(this));
+        this._updateVisibility();
     }
 
     _getFitAllBox(box, spacing, vertical) {
@@ -320,11 +321,7 @@ class WorkspacesView extends WorkspacesViewBase {
         return this._workspaces[active];
     }
 
-    animateToOverview() {
-        this._updateVisibility();
-    }
-
-    animateFromOverview() {
+    prepareToLeaveOverview() {
         for (let w = 0; w < this._workspaces.length; w++)
             this._workspaces[w].prepareToLeaveOverview();
     }
@@ -487,10 +484,7 @@ class ExtraWorkspaceView extends WorkspacesViewBase {
         return this._workspace;
     }
 
-    animateToOverview() {
-    }
-
-    animateFromOverview() {
+    prepareToLeaveOverview() {
         this._workspace.prepareToLeaveOverview();
     }
 
@@ -709,13 +703,10 @@ class WorkspacesDisplay extends St.Widget {
             primaryWorkspace.visible = visible;
     }
 
-    animateToOverview() {
+    prepareToEnterOverview() {
         this.show();
         this._updateWorkspacesViews();
 
-        for (let i = 0; i < this._workspacesViews.length; i++)
-            this._workspacesViews[i].animateToOverview();
-
         this._restackedNotifyId =
             Main.overview.connect('windows-restacked',
                                   this._onRestacked.bind(this));
@@ -726,9 +717,9 @@ class WorkspacesDisplay extends St.Widget {
             this._keyPressEventId = global.stage.connect('key-press-event', this._onKeyPressEvent.bind(this));
     }
 
-    animateFromOverview() {
+    prepareToLeaveOverview() {
         for (let i = 0; i < this._workspacesViews.length; i++)
-            this._workspacesViews[i].animateFromOverview();
+            this._workspacesViews[i].prepareToLeaveOverview();
 
         this._leavingOverview = true;
         this._updateSwipeTracker();